class MyCesium {
  #Cesium;
  #viewer;

  constructor(Cesium, viewer) {
    this.#Cesium = Cesium;
    this.#viewer = viewer;
  }

  setView(position, options) {
    this.#viewer.camera.setView({
      destination: this.#Cesium.Cartesian3.fromDegrees(...position),
      orientation: {
        heading: this.#Cesium.Math.toRadians(0),
        pitch: this.#Cesium.Math.toRadians(-60.0), // 角度转换
        roll: 0,
      },
      ...(options || {})
    })
  }

  lockAngle() {
    this.#viewer.scene.screenSpaceCameraController.enableTilt = false; // 禁止中键旋转视角
  }

  setZoom(min, max) {
    if (min) {
      this.#viewer.scene.screenSpaceCameraController.minimumZoomDistance = min; // 设置相机的最小高度
    }
    if (max) {
      this.#viewer.scene.screenSpaceCameraController.maximumZoomDistance = max; // 设置相机的最大高度
    }
  }
}

export default MyCesium